/**
 * Represents Personal Computer element
 */
package logic.pathelements;

import java.util.Random;


/**
 * Personal Computer class.
 * @author Dmitry Kuznetsov <zendipy@gmail.com>
 * @version 1.0
 */
public class PC extends ActiveElement {
	// Random number generator
	private static Random rnd = new Random();

	/**
	 * Constructor. Execute parent constructor of {@link ActiveElement}
	 * @param id						element id
	 * @param name						element name
	 * @param networkInterfacesCount	quantity of interfaces
	 * @throws Exception				exception
	 */
	public PC(Integer id, String name, int networkInterfacesCount)
			throws Exception {
		super(id, name, networkInterfacesCount);
	}

	
	/**
	 * Get cost of the transmission
	 * @return random cost from 0 to 1000
	 */
	@Override
	public double getCosts() {
		return rnd.nextInt(1000);
	}

	/**
	 * Get information of this device.
	 * @return string with the info of this object
	 */
	@Override
	public String getInfo() {
		String info = 
				"Workstation. Id: " + this.id +
				", Name: " + this.name +
				", ClassName:" + this.getClass().getName();
		return info;
	}

	/**
	 * Generate delay from 0s to 10000ms at random
	 * @return milliseconds of delay
	 */
	@Override
	public double getTimeDelay() {
		return rnd.nextInt(10001);
	}
	
	
	
}
